Skip to content

fix(deploy): add CORS origins env var to API deployment#451

Merged
jsell-rh merged 1 commit intomainfrom
jsell/fix/cors-env-var
Apr 23, 2026
Merged

fix(deploy): add CORS origins env var to API deployment#451
jsell-rh merged 1 commit intomainfrom
jsell/fix/cors-env-var

Conversation

@jsell-rh
Copy link
Copy Markdown
Collaborator

@jsell-rh jsell-rh commented Apr 23, 2026

Summary

The CORS origins were in the ConfigMap but the API deployment never read the key — KARTOGRAPH_CORS_ORIGINS was missing from the container's env spec. The CORS middleware never initialized, causing OPTIONS preflight requests to return 405.

Adds configMapKeyRef for KARTOGRAPH_CORS_ORIGINS with optional: true so deployments without CORS config still work.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • API CORS origins can now be configured per deployment environment without code changes.

The ConfigMap had the CORS origins but the API deployment never
read the key — it was missing from the container's env spec.
OPTIONS preflight requests returned 405 because the CORS middleware
was never initialized.

Marked optional so local/dev deployments without CORS config still
work (CORS disabled by default when origins list is empty).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 15ada4d2-9da0-4990-9b35-174a5b6b0f89

📥 Commits

Reviewing files that changed from the base of the PR and between 8b6edc4 and cf5183c.

📒 Files selected for processing (1)
  • deploy/apps/kartograph/base/api-deployment.yaml

Walkthrough

A new environment variable KARTOGRAPH_CORS_ORIGINS is added to the Kartograph API container in the Kubernetes deployment manifest. The variable is configured to read from the kartograph-config ConfigMap using optional value references, allowing CORS origins to be managed externally without requiring the ConfigMap key to exist at deployment time.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a CORS origins environment variable to the API deployment in the deploy configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jsell/fix/cors-env-var

Comment @coderabbitai help to get the list of available commands and usage tips.

@jsell-rh jsell-rh merged commit 224de76 into main Apr 23, 2026
9 of 10 checks passed
@jsell-rh jsell-rh deleted the jsell/fix/cors-env-var branch April 23, 2026 20:44
jsell-rh added a commit that referenced this pull request May 2, 2026
)

The ConfigMap had the CORS origins but the API deployment never
read the key — it was missing from the container's env spec.
OPTIONS preflight requests returned 405 because the CORS middleware
was never initialized.

Marked optional so local/dev deployments without CORS config still
work (CORS disabled by default when origins list is empty).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jsell-rh added a commit that referenced this pull request May 2, 2026
)

The ConfigMap had the CORS origins but the API deployment never
read the key — it was missing from the container's env spec.
OPTIONS preflight requests returned 405 because the CORS middleware
was never initialized.

Marked optional so local/dev deployments without CORS config still
work (CORS disabled by default when origins list is empty).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant